#ifndef __GE_PASS_H__
#define __GE_PASS_H__

#include "GE_Base.h"
namespace Syp
{
///A Pass encompasses Render calls required to produce a particular effect. One/Several Passes are combined to produce an Effect.
class SYPAPI Pass
{
	friend class Renderer;
public:

///This function is called upon the registering of the parent Effect. This is where you should check the client's hardware capabilities to determine if this Pass should be executed or a fallback Effect(if available) should be used.
virtual bool runnableOnHardware()=0;
///Setup done before pass is drawn. Stuff such as binding vertex/texture/normal/attribute streams can be done here. Transformations/software-skinning/rendertargets.
virtual void preDraw()=0;
///Any cleanup/popping of matrices/etc.. should be done here. Performed after the pass has been drawn.
virtual void postDraw()=0;
///Returns name of Pass
String& getName();
///Pass will activate following ShaderProgram before drawing.If not set, default fixed-functionality pipeline will be used.
void useShaderProgram(ShaderProgram* s);
///Returns a pointer to the current ShaderProgram this pass is using. Returns 0 if not in use.
ShaderProgram* getShaderProgram();
///Returns the PassType of this Pass
PassType getPassType();
///Deletes self. Overloaded variants just have to delete themselves. This is necessary to avoid cross-DLL new/delete problems on Windows.
/// delete this;
virtual void destroy() = 0;
///Do not ever delete a Pass, if you want to free it up, use PassRegistry to remove it.
virtual ~Pass();
protected:
Pass(const String& Name,const String& Description,PassType type = ACTUAL);
private:
	///The type of work the Pass does
	PassType pt;
	///Name of Pass
	String name;
	///Description of Pass/Notes for users/Things to take note of.
	String description;	
	///Pointer to ShaderProgram to use.
	ShaderProgram* sp;
};
}
#endif //__GE_PASS_H__
